<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/core/common/top.jsp" %>
<script src="${ctx}/core/scripts/jquery_last.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/formValidator.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
<script language="javascript">
<!--
	
	$(document).ready(function(){
		$.formValidator.initConfig({formid:"form0",onerror:function(msg){showMessage(msg);},onsuccess:function(msg){
				if(!isFtpUrl()) return false;
				$("#button1").attr('disabled',true);
				document.getElementById("info").style.display="";
			}
		});
		$("#ftpUrl").formValidator().inputValidator({min:1,onerror:"<s:text name='import.url.not.empty'/>"});
	});	

	function isFtpUrl(){
		var url = document.getElementById("ftpUrl").value;
		var ftpUrlReg = /(ftp):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/gi ;
		if(!ftpUrlReg.test(url)){
			showMessage("<s:text name='ftp.url.format.error'/>");
			return false;
		}
		return true;
	}

   function importInput(){
   		location="${ctx}/contentManage/contentImport.action?act=doImportInput";
   }
   
   function batchImportInput(){
   		location="${ctx}/contentManage/contentImport.action?act=doBatchImportInput";
   }
   
   function importTask(){
		location="${ctx}/contentManage/importTask.action?q_status=0";
   } 
   
//-->
</script>
<body style="overflow-x:hidden;overflow-y:auto;">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<%@include file="/WEB-INF/core/common/message.jsp"  %>
<form method="post" action="${ctx}/contentManage/contentImport.action" name="form0" id="form0">
<s:hidden name="act" value="doBatchImport"></s:hidden>
   <tr>
    <td width="8"><img src="${ctx}/core/images/button_05.gif" width="8" height="27" /></td>
    <td width="99%" align="left" valign="middle" background="${ctx}/core/images/button_06.gif" class="bluecu">&nbsp;<img src="${ctx}/core/images/icon_04.gif" />&nbsp;<s:text name="content.import"/></td>
    <td width="8"><img src="${ctx}/core/images/button_07.gif" width="8" height="27" /></td>
  </tr>
  <tr>
    <td colspan="3" align="center" valign="top" class="biaoge">


      <table width="100%" height="21" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
        <td onClick="javascript:importInput();">
              <table cellpadding="0" cellspacing="0" width="100%" style="width:60px;cursor:hand;">
                <tr>
                  <td width="5" class="tab_underline1"><img src="${ctx}/core/images/gray_left.gif" /></td>
                  <td align="center" class="tab_button_gray" nowrap="nowrap">&nbsp;<s:text name="adi.import"/>&nbsp;</td>
                  <td width="5" class="tab_underline1"><img src="${ctx}/core/images/gray_right.gif" /></td>
                </tr>
            </table></td>
         <td onClick="javascript:batchImportInput();">
              <table cellpadding="0" cellspacing="0" width="100%" style="width:60px;cursor:hand;">
                <tr>
                  <td width="5"><img src="${ctx}/core/images/blue_left.gif" /></td>
                  <td align="center" class="tab_button_blue" nowrap="nowrap">&nbsp;<s:text name="adi.batch.import"/>&nbsp;</td>
                  <td width="5"><img src="${ctx}/core/images/blue_right.gif" /></td>
                </tr>
            </table></td>
         <td onClick="javascript:importTask();">
              <table cellpadding="0" cellspacing="0" width="100%" style="width:60px;cursor:hand;">
                <tr>
                  <td width="5" class="tab_underline1"><img src="${ctx}/core/images/gray_left.gif" /></td>
                  <td align="center" class="tab_button_gray" nowrap="nowrap">&nbsp;<s:text name="adi.import.task"/>&nbsp;</td>
                  <td width="5" class="tab_underline1"><img src="${ctx}/core/images/gray_right.gif" /></td>
                </tr>
            </table></td>   
        <td width="90%" class="tab_underline1">&nbsp;</td>
      </tr>
      </table>

	  
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="kuang">
		<tr><td height="10px"></td></tr>
        <tr>
          <td valign="top">
		  <table width="100%" border="0" align="center" cellspacing="0">
          <tr>
            <!-- 查询条件 -->
            <td class="tabulation">

			<table bordercolor=#ffffff cellspacing=1 cellpadding=0 width="100%" border=0>
				<tr bgcolor="#DDE4EA">
							<td align="left" width="15%" nowrap><span><s:text name="adi.task.name"/></span></td>
							<td align="left">
							  <input name="taskName" value="untitled"></input>
							 </td> 
			    </tr>
			    <tr bgcolor="#DDE4EA">
							<td align="left" nowrap><span><s:text name="adi.import.url"/><font color="red">*</font></span></td>
							<td align="left">
							    <textarea id="ftpUrl" name="ftpUrl"  cols="70" rows="4"><s:property value="ftpUrl"/></textarea>
					            <span><font color="blue"><strong><nobr>Example:ftp://USER:PASS@HOST:PORT/FOLDER</nobr></strong></span>
							</td> 
			     </tr>

			  <tr align=left>
                <td colspan="2" align="left" height=27>
					<input type="submit" name="submit" id="button1" value="<s:text name='button.import'/>" class="btn">
				</td>

              </tr>
              <tr><td colspan="2" height="20px"><span id="info" style="display:none"><s:text name="ftp.url.test"/></span></td></tr>
            </table>
            
            </td>
          </tr>
             </table>
		  </td>
          </tr>
      </table>
	  </td></tr>
</form>
 </table>
</body>